library(tidyverse)
library(gt)
use("glue", "glue")
use("readxl", "read_xlsx")
use("htmltools", "HTML")
use("here", "here")
use("htmlwidgets", "onRender")
use("RColorBrewer", "brewer.pal")
use("scales", c("label_percent", "percent", "alpha"))
df <- read_xlsx(
here(
"wgm2018-dataset-crosstabs-all-countries.xlsx"
),
sheet = 2
)
df <- "0=Not assigned, 1=Africa,2=Africa,3=Africa,4=Africa,5=Africa,6=Americas,7=Americas,8=Americas,9=Asia,10=Asia,11=Asia,12=Asia,13=Middle East,14=Former Soviet Union,15=Europe,16=Europe,17=Europe,18=Asia" |>
str_split(",") |>
unlist() |>
str_trim() |>
as_tibble() |>
separate_wider_delim(value, "=", names = c("Regions_Report", "Region")) |>
mutate(Regions_Report = as.numeric(Regions_Report)) |>
right_join(df) |>
select(-Regions_Report)
df <- "1=United States, 2=Egypt, 3=Morocco, 4=Lebanon, 5=Saudi Arabia, 6=Jordan, 8=Turkey, 9=Pakistan, 10=Indonesia, 11=Bangladesh, 12=United Kingdom, 13=France, 14=Germany, 15=Netherlands, 16=Belgium, 17=Spain, 18=Italy, 19=Poland, 20=Hungary, 21=Czech Republic, 22=Romania, 23=Sweden, 24=Greece, 25=Denmark, 26=Iran, 28=Singapore, 29=Japan, 30=China, 31=India, 32=Venezuela, 33=Brazil, 34=Mexico, 35=Nigeria, 36=Kenya, 37=Tanzania, 38=Israel, 39=Palestinian Territories, 40=Ghana, 41=Uganda, 42=Benin, 43=Madagascar, 44=Malawi, 45=South Africa, 46=Canada, 47=Australia, 48=Philippines, 49=Sri Lanka, 50=Vietnam, 51=Thailand, 52=Cambodia, 53=Laos, 54=Myanmar, 55=New Zealand, 57=Botswana, 60=Ethiopia, 61=Mali, 62=Mauritania, 63=Mozambique, 64=Niger, 65=Rwanda, 66=Senegal, 67=Zambia, 68=South Korea, 69=Taiwan, 70=Afghanistan, 71=Belarus, 72=Georgia, 73=Kazakhstan, 74=Kyrgyzstan, 75=Moldova, 76=Russia, 77=Ukraine, 78=Burkina Faso, 79=Cameroon, 80=Sierra Leone, 81=Zimbabwe, 82=Costa Rica, 83=Albania, 84=Algeria, 87=Argentina, 88=Armenia, 89=Austria, 90=Azerbaijan, 96=Bolivia, 97=Bosnia and Herzegovina, 99=Bulgaria, 100=Burundi, 103=Chad, 104=Chile, 105=Colombia, 106=Comoros, 108=Republic of Congo, 109=Croatia, 111=Cyprus, 114=Dominican Republic, 115=Ecuador, 116=El Salvador, 119=Estonia, 121=Finland, 122=Gabon, 124=Guatemala, 125=Guinea, 128=Haiti, 129=Honduras, 130=Iceland, 131=Iraq, 132=Ireland, 134=Ivory Coast, 137=Kuwait, 138=Latvia, 140=Liberia, 141=Libya, 143=Lithuania, 144=Luxembourg, 145=Macedonia, 146=Malaysia, 148=Malta, 150=Mauritius, 153=Mongolia, 154=Montenegro, 155=Namibia, 157=Nepal, 158=Nicaragua, 160=Norway, 163=Panama, 164=Paraguay, 165=Peru, 166=Portugal, 173=Serbia, 175=Slovakia, 176=Slovenia, 183=Eswatini, 184=Switzerland, 185=Tajikistan, 186=The Gambia, 187=Togo, 190=Tunisia, 191=Turkmenistan, 193=United Arab Emirates, 194=Uruguay, 195=Uzbekistan, 197=Yemen, 198=Kosovo, 202=Northern Cyprus" |>
str_split(",") |>
unlist() |>
str_trim() |>
as_tibble() |>
separate_wider_delim(value, "=", names = c("WP5", "Country")) |>
mutate(WP5 = as.numeric(WP5)) |>
right_join(df) |>
select(-WP5)
region_colours <- brewer.pal(7, "Dark2")Trust in Science in the 2018 Global Health Monitor Report
library(leaflet)
library(rnaturalearth)
library(sf)Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE
science <- df |>
drop_na(Q1) |>
mutate(science = Q1 < 3, across(c(Country, Region), fct)) |>
group_by(Country, Region) |>
summarize(percent = mean(science), .groups = "drop")
country_data <- ne_countries(scale = "medium", returnclass = "sf") |>
mutate(
admin = case_when(
admin == "United States of America" ~ "United States",
admin == "Czechia" ~ "Czech Republic",
admin == "Palestine" ~ "Palestinian Territories",
admin == "Republic of the Congo" ~ "Republic of Congo",
admin == "Gambia" ~ "The Gambia",
admin == "United Republic of Tanzania" ~ "Tanzania",
admin == "North Macedonia" ~ "Macedonia",
admin == "Republic of Serbia" ~ "Serbia",
admin == "Republic of Serbia" ~ "Serbia",
TRUE ~ admin
)
) |>
right_join(science, by = join_by(admin == Country)) |>
drop_na(scalerank)vaccine <- df |>
drop_na(Q25, Q26) |>
mutate(
safe = Q25 %in% c(4, 5),
effective = Q26 %in% c(4, 5),
across(c(Country, Region), fct)
) |>
group_by(Country, Region) |>
summarize(
safe = mean(safe),
effective = mean(effective),
.groups = "drop"
)Science
Column - 1
Perceived Science Knowledge per Country
Perceived Science Knowledge per Country
Percentage of people who answered “a lot” or “some” to the question: How much do you, personally, know about science? Do you know a lot, some, not much, or nothing at all?
country_colours <- colorNumeric(
palette = "Purples",
domain = country_data$percent,
na.color = "#bdbdbd"
)
country_labels <- glue(
"<strong>{country_data$admin}</strong><br/>{percent(country_data$percent, accuracy = 0.1)}"
) |>
lapply(HTML)
country_data |>
leaflet() |>
addTiles(options = tileOptions(noWrap = TRUE)) |>
addPolygons(
fillColor = ~ country_colours(percent),
weight = 1,
opacity = 1,
color = "white",
dashArray = "3",
fillOpacity = 0.7,
label = country_labels,
highlightOptions = highlightOptions(
weight = 3,
color = "#666",
dashArray = "",
fillOpacity = 0.9,
bringToFront = TRUE
),
group = "Countries"
) |>
onRender("
function(el, x) {
// Select the map container element (el) and set its background style
el.style.backgroundColor = 'transparent';
}
") Data
science |>
arrange(desc(percent)) |>
gt() |>
fmt_percent(columns = percent, decimals = 1) |>
cols_label(
Country = "Country",
percent = "Science Knowledge"
) |>
opt_row_striping(FALSE) |>
data_color(
columns = Region,
method = "factor",
palette = alpha(region_colours, 0.5)
)| Country | Region | Science Knowledge |
|---|---|---|
| United States | Americas | 83.4% |
| Norway | Europe | 81.7% |
| Turkmenistan | Asia | 79.7% |
| Denmark | Europe | 76.8% |
| France | Europe | 75.2% |
| Luxembourg | Europe | 74.8% |
| Northern Cyprus | Not assigned | 73.7% |
| Canada | Americas | 73.2% |
| Sweden | Europe | 73.0% |
| Armenia | Asia | 72.6% |
| Spain | Europe | 72.3% |
| Belarus | Former Soviet Union | 72.0% |
| Germany | Europe | 72.0% |
| Switzerland | Europe | 71.2% |
| Slovenia | Europe | 70.6% |
| Belgium | Europe | 69.7% |
| Ukraine | Former Soviet Union | 69.3% |
| United Kingdom | Europe | 68.1% |
| Finland | Europe | 67.3% |
| Poland | Former Soviet Union | 66.6% |
| Azerbaijan | Asia | 66.4% |
| Portugal | Europe | 65.5% |
| Iran | Middle East | 65.3% |
| Australia | Asia | 64.6% |
| Kenya | Africa | 64.5% |
| Montenegro | Europe | 64.4% |
| Hungary | Former Soviet Union | 63.2% |
| Estonia | Europe | 62.9% |
| New Zealand | Asia | 62.6% |
| United Arab Emirates | Middle East | 62.5% |
| Moldova | Former Soviet Union | 62.3% |
| Sri Lanka | Asia | 62.2% |
| Turkey | Middle East | 61.5% |
| Singapore | Asia | 61.4% |
| Netherlands | Europe | 61.3% |
| Lebanon | Middle East | 61.1% |
| Iceland | Europe | 61.0% |
| Malta | Europe | 61.0% |
| Cyprus | Europe | 60.8% |
| Croatia | Europe | 60.3% |
| Ireland | Europe | 59.9% |
| Cameroon | Africa | 59.3% |
| Mauritius | Africa | 58.6% |
| Saudi Arabia | Middle East | 58.5% |
| Russia | Former Soviet Union | 58.4% |
| Palestinian Territories | Middle East | 58.0% |
| Uganda | Africa | 57.6% |
| Austria | Europe | 57.6% |
| Jordan | Middle East | 57.6% |
| Ivory Coast | Africa | 57.4% |
| Chad | Africa | 57.0% |
| Serbia | Europe | 57.0% |
| Georgia | Asia | 56.9% |
| Tajikistan | Asia | 56.1% |
| Philippines | Asia | 55.6% |
| Iraq | Middle East | 55.3% |
| Benin | Africa | 55.1% |
| Kuwait | Middle East | 54.6% |
| Lithuania | Europe | 54.4% |
| Bosnia and Herzegovina | Europe | 54.3% |
| Algeria | Africa | 54.2% |
| Kazakhstan | Asia | 53.4% |
| Gabon | Africa | 53.1% |
| Ghana | Africa | 52.7% |
| Nepal | Asia | 52.2% |
| Kyrgyzstan | Asia | 51.8% |
| Peru | Americas | 51.0% |
| Romania | Former Soviet Union | 50.9% |
| Macedonia | Europe | 50.9% |
| Dominican Republic | Americas | 50.8% |
| Uzbekistan | Asia | 50.7% |
| Libya | Africa | 50.6% |
| Republic of Congo | Africa | 50.5% |
| Malaysia | Asia | 50.5% |
| Haiti | Americas | 50.2% |
| Zambia | Africa | 49.7% |
| Slovakia | Former Soviet Union | 49.7% |
| Bolivia | Americas | 49.1% |
| Namibia | Africa | 48.7% |
| Tunisia | Africa | 48.7% |
| Bangladesh | Asia | 47.6% |
| South Korea | Asia | 47.5% |
| Guinea | Africa | 47.3% |
| Tanzania | Africa | 47.2% |
| Burkina Faso | Africa | 47.2% |
| Italy | Europe | 47.1% |
| Kosovo | Not assigned | 47.1% |
| India | Asia | 47.0% |
| Zimbabwe | Africa | 46.9% |
| Czech Republic | Former Soviet Union | 46.7% |
| Taiwan | Asia | 45.6% |
| Ethiopia | Africa | 45.1% |
| Israel | Middle East | 45.0% |
| Panama | Americas | 44.8% |
| Latvia | Europe | 44.7% |
| Nicaragua | Americas | 44.3% |
| Togo | Africa | 44.3% |
| Morocco | Africa | 43.7% |
| Bulgaria | Former Soviet Union | 43.7% |
| Argentina | Americas | 43.4% |
| Mali | Africa | 42.8% |
| Uruguay | Americas | 42.8% |
| Afghanistan | Asia | 42.3% |
| Costa Rica | Americas | 42.1% |
| Venezuela | Americas | 41.7% |
| Ecuador | Americas | 41.7% |
| Liberia | Africa | 41.6% |
| Mexico | Americas | 41.3% |
| Nigeria | Africa | 41.1% |
| Chile | Americas | 41.0% |
| Mauritania | Africa | 40.7% |
| Egypt | Africa | 40.3% |
| Botswana | Africa | 39.5% |
| Comoros | Africa | 39.4% |
| Senegal | Africa | 39.3% |
| Mongolia | Asia | 39.3% |
| Greece | Europe | 39.0% |
| Burundi | Africa | 38.4% |
| Colombia | Americas | 38.3% |
| Mozambique | Africa | 38.2% |
| Pakistan | Asia | 37.8% |
| Albania | Europe | 37.2% |
| Indonesia | Asia | 36.9% |
| Paraguay | Americas | 36.4% |
| Thailand | Asia | 36.2% |
| Japan | Asia | 35.8% |
| El Salvador | Americas | 35.5% |
| Honduras | Americas | 34.9% |
| Yemen | Middle East | 34.8% |
| Guatemala | Americas | 33.9% |
| Madagascar | Africa | 33.5% |
| South Africa | Africa | 33.1% |
| Eswatini | Africa | 31.5% |
| Laos | Asia | 30.2% |
| Myanmar | Asia | 29.8% |
| Cambodia | Asia | 28.2% |
| Brazil | Americas | 28.0% |
| Niger | Africa | 27.2% |
| The Gambia | Africa | 23.8% |
| Sierra Leone | Africa | 23.1% |
| Vietnam | Asia | 22.7% |
| Malawi | Africa | 22.5% |
| China | Asia | 21.6% |
| Rwanda | Africa | 12.0% |
Column - 2
Americans had the highest percentage of respondents who perceived themselves as being knowledgeable about science (~83%); however, around 10% of respondents disagreed on the safety of vaccines and about 5% of respondents disputed vaccines’ effectiveness.
Surveyed respondents from Egypt expressed some of the least disbelief in the effectiveness (~0.5%) and safety (~0.3%) amongst all respondents. This stands in stark contrast to the United States.
Vaccine Belief
Column - 1
Vaccine Safety and Efficacy
library(plotly)
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
p <- vaccine |>
ggplot(aes(
x = safe,
y = effective
)) +
geom_point(aes(
text = glue(
"Country: {Country}<br>",
"Region: {Region}<br>",
"Safe: {percent(safe, accuracy = 0.01)}<br>",
"Effective: {percent(effective, accuracy = 0.01)}"
),
color = Region
)) +
geom_smooth(method = "lm", se = FALSE, linewidth = 0.5) +
labs(
x = "Disagree on Safety",
y = "Disagree on Efficacy",
title = "Positive Relation Between Disbelief in Vaccine Safety and Efficacy"
) +
scale_x_continuous(labels = label_percent()) +
scale_y_continuous(labels = label_percent()) +
scale_color_manual(values = region_colours) +
theme_bw() +
theme(legend.position = "none")Warning in geom_point(aes(text = glue("Country: {Country}<br>", "Region:
{Region}<br>", : Ignoring unknown aesthetics: text
ggplotly(p, tooltip = "text")`geom_smooth()` using formula = 'y ~ x'
vaccine |>
mutate(tmp = (safe + effective) / 2) |>
arrange(tmp) |>
select(-tmp) |>
gt() |>
fmt_percent(columns = c(safe, effective), decimals = 1) |>
cols_label(
safe = "Safety",
effective = "Efficacy"
) |>
data_color(
columns = Region,
method = "factor",
palette = alpha(region_colours, 0.5)
)| Country | Region | Safety | Efficacy |
|---|---|---|---|
| Egypt | Africa | 0.3% | 0.5% |
| Bangladesh | Asia | 0.8% | 0.4% |
| Tajikistan | Asia | 1.3% | 1.0% |
| Rwanda | Africa | 1.8% | 0.8% |
| Laos | Asia | 2.1% | 0.9% |
| India | Asia | 2.1% | 1.9% |
| Hungary | Former Soviet Union | 2.5% | 1.5% |
| Lebanon | Middle East | 3.2% | 1.2% |
| Ethiopia | Africa | 3.1% | 1.5% |
| Malawi | Africa | 2.8% | 1.8% |
| Palestinian Territories | Middle East | 2.7% | 1.9% |
| Uzbekistan | Asia | 3.5% | 1.3% |
| Singapore | Asia | 2.8% | 2.2% |
| Thailand | Asia | 2.8% | 2.3% |
| Tanzania | Africa | 1.8% | 3.5% |
| Northern Cyprus | Not assigned | 4.1% | 1.6% |
| Jordan | Middle East | 3.2% | 2.5% |
| Myanmar | Asia | 3.7% | 2.3% |
| Zimbabwe | Africa | 4.1% | 1.9% |
| Venezuela | Americas | 3.8% | 2.2% |
| Dominican Republic | Americas | 4.0% | 2.3% |
| Israel | Middle East | 4.7% | 1.7% |
| Afghanistan | Asia | 4.5% | 1.9% |
| Nicaragua | Americas | 2.9% | 3.6% |
| Greece | Europe | 4.1% | 2.5% |
| Kuwait | Middle East | 4.0% | 2.6% |
| Cambodia | Asia | 5.3% | 1.8% |
| Yemen | Middle East | 3.5% | 3.6% |
| Morocco | Africa | 3.3% | 4.1% |
| Malaysia | Asia | 2.9% | 4.6% |
| Slovakia | Former Soviet Union | 5.5% | 2.3% |
| Tunisia | Africa | 4.7% | 3.1% |
| Argentina | Americas | 4.7% | 3.3% |
| Saudi Arabia | Middle East | 4.3% | 3.8% |
| Iraq | Middle East | 4.5% | 3.6% |
| United Arab Emirates | Middle East | 4.5% | 3.7% |
| Ghana | Africa | 3.9% | 4.6% |
| Sierra Leone | Africa | 4.2% | 4.6% |
| Czech Republic | Former Soviet Union | 6.1% | 2.7% |
| Burundi | Africa | 5.9% | 3.1% |
| Norway | Europe | 6.2% | 2.8% |
| Turkmenistan | Asia | 4.2% | 4.8% |
| South Korea | Asia | 6.9% | 2.2% |
| Australia | Asia | 6.0% | 3.3% |
| Pakistan | Asia | 4.7% | 4.9% |
| Costa Rica | Americas | 5.1% | 4.6% |
| Turkey | Middle East | 6.5% | 3.4% |
| Sri Lanka | Asia | 7.1% | 2.9% |
| Spain | Europe | 5.5% | 4.7% |
| The Gambia | Africa | 5.1% | 5.1% |
| Poland | Former Soviet Union | 6.0% | 4.3% |
| Iran | Middle East | 8.3% | 2.0% |
| Panama | Americas | 5.0% | 5.5% |
| United Kingdom | Europe | 8.1% | 2.6% |
| China | Asia | 7.9% | 2.9% |
| Honduras | Americas | 5.8% | 5.1% |
| Nepal | Asia | 4.0% | 6.9% |
| Japan | Asia | 8.2% | 2.9% |
| Comoros | Africa | 8.4% | 2.7% |
| Kosovo | Not assigned | 5.8% | 5.4% |
| Niger | Africa | 7.3% | 4.0% |
| Ireland | Europe | 8.0% | 3.5% |
| Malta | Europe | 6.8% | 5.0% |
| Lithuania | Europe | 7.9% | 3.9% |
| Libya | Africa | 7.1% | 4.7% |
| Finland | Europe | 7.7% | 4.1% |
| Croatia | Europe | 7.4% | 4.5% |
| Kenya | Africa | 4.7% | 7.4% |
| Mexico | Americas | 6.8% | 5.4% |
| Vietnam | Asia | 9.1% | 3.2% |
| Ecuador | Americas | 5.8% | 6.5% |
| Cyprus | Europe | 7.8% | 4.7% |
| Serbia | Europe | 8.1% | 4.5% |
| Portugal | Europe | 4.9% | 8.4% |
| Botswana | Africa | 9.2% | 4.1% |
| Denmark | Europe | 9.0% | 4.4% |
| Sweden | Europe | 10.9% | 2.5% |
| Bosnia and Herzegovina | Europe | 7.9% | 5.9% |
| Georgia | Asia | 9.2% | 4.6% |
| Guatemala | Americas | 7.6% | 6.7% |
| Paraguay | Americas | 7.0% | 7.4% |
| Canada | Americas | 8.4% | 6.3% |
| Mozambique | Africa | 5.3% | 9.6% |
| Mauritania | Africa | 10.3% | 4.7% |
| United States | Americas | 10.2% | 5.0% |
| New Zealand | Asia | 9.3% | 6.1% |
| Brazil | Americas | 9.3% | 6.6% |
| Romania | Former Soviet Union | 10.9% | 5.2% |
| Madagascar | Africa | 10.7% | 5.7% |
| Uruguay | Americas | 9.7% | 6.8% |
| Kazakhstan | Asia | 11.1% | 5.8% |
| Kyrgyzstan | Asia | 9.4% | 7.9% |
| Colombia | Americas | 10.0% | 7.3% |
| Indonesia | Asia | 5.8% | 11.7% |
| Eswatini | Africa | 10.4% | 7.2% |
| Chile | Americas | 11.5% | 6.7% |
| Germany | Europe | 14.4% | 3.8% |
| Zambia | Africa | 8.6% | 9.7% |
| Algeria | Africa | 10.7% | 7.8% |
| Italy | Europe | 13.6% | 4.9% |
| Estonia | Europe | 12.8% | 6.3% |
| Azerbaijan | Asia | 10.8% | 8.3% |
| Luxembourg | Europe | 13.7% | 5.6% |
| Moldova | Former Soviet Union | 11.3% | 8.1% |
| El Salvador | Americas | 11.5% | 7.9% |
| Slovenia | Europe | 11.8% | 7.8% |
| Bolivia | Americas | 12.3% | 7.8% |
| South Africa | Africa | 8.7% | 11.3% |
| Chad | Africa | 11.5% | 8.7% |
| Macedonia | Europe | 12.5% | 7.7% |
| Montenegro | Europe | 13.1% | 7.2% |
| Mongolia | Asia | 15.1% | 5.4% |
| Mauritius | Africa | 16.4% | 4.9% |
| Mali | Africa | 16.2% | 5.5% |
| Uganda | Africa | 8.7% | 12.9% |
| Republic of Congo | Africa | 18.4% | 3.9% |
| Guinea | Africa | 15.4% | 7.3% |
| Iceland | Europe | 21.3% | 1.4% |
| Nigeria | Africa | 6.1% | 16.7% |
| Benin | Africa | 15.0% | 7.8% |
| Bulgaria | Former Soviet Union | 15.4% | 7.5% |
| Ukraine | Former Soviet Union | 15.9% | 7.8% |
| Albania | Europe | 15.4% | 8.4% |
| Senegal | Africa | 14.3% | 9.6% |
| Philippines | Asia | 14.2% | 9.8% |
| Cameroon | Africa | 15.3% | 9.0% |
| Belarus | Former Soviet Union | 15.4% | 10.0% |
| Taiwan | Asia | 19.0% | 6.9% |
| Ivory Coast | Africa | 18.1% | 8.0% |
| Namibia | Africa | 11.0% | 15.9% |
| Latvia | Europe | 17.0% | 10.0% |
| Belgium | Europe | 21.5% | 5.6% |
| Burkina Faso | Africa | 21.2% | 9.0% |
| Netherlands | Europe | 18.4% | 12.1% |
| Haiti | Americas | 21.2% | 9.5% |
| Liberia | Africa | 2.3% | 28.8% |
| Switzerland | Europe | 22.5% | 9.1% |
| Austria | Europe | 21.0% | 11.2% |
| Peru | Americas | 17.6% | 15.2% |
| Armenia | Asia | 20.8% | 13.1% |
| Togo | Africa | 24.8% | 10.2% |
| Russia | Former Soviet Union | 23.4% | 12.2% |
| Gabon | Africa | 26.9% | 11.3% |
| France | Europe | 31.8% | 15.9% |
Column - 2
Vaccine Belief by Region and Country
Percentage of people who agreed with the statement: Vaccines are safe.
library(gghalves)
# Taken from https://github.com/teunbrand/ggplot_tricks?tab=readme-ov-file#lets-begin
my_fill <- aes(fill = after_scale(alpha(colour, 0.3)))
# A small nudge offset
offset <- 0.025
vaccine_info <- df |>
drop_na(Q25) |>
mutate(
vaccine = Q25 < 3,
across(c(Country, Region), fct)
) |>
filter(Region != "Not assigned") |>
group_by(Region, Country) |>
summarize(percent = mean(vaccine), .groups = "drop_last")
vaccine_info |>
ggplot(
aes(
x = fct_reorder(Region, percent),
y = percent,
colour = Region,
!!!my_fill
)
) +
geom_half_violin(side = "l", trim = FALSE, scale = "width") +
geom_half_boxplot(
side = "l",
coef = 0,
width = 0.4,
outliers = FALSE,
alpha = 0.3
) +
geom_half_dotplot(
method = "histodot",
stackdir = "up",
dotsize = 1,
binwidth = 0.01
) +
scale_y_continuous(labels = label_percent(), limits = c(0, 1)) +
scale_color_manual(values = region_colours) +
scale_fill_manual(values = region_colours) +
coord_flip() +
labs(
x = element_blank(),
y = element_blank(),
title = element_blank()
) +
theme_bw() +
theme(legend.position = "none")Warning: Removed 278 rows containing missing values or values outside the scale range
(`geom_half_violin()`).
vaccine_info |>
ungroup() |>
mutate(Region = fct_reorder(Region, percent, .desc = TRUE)) |>
group_by(Region) |>
arrange(desc(percent), .by_group = TRUE) |>
gt() |>
fmt_percent(columns = percent, decimals = 1) |>
cols_label(
percent = "Vaccine Belief"
) |>
data_color(
columns = Region,
method = "factor",
palette = alpha(region_colours, 0.5)
)| Country | Vaccine Belief |
|---|---|
| Asia | |
| Bangladesh | 97.7% |
| India | 95.8% |
| Afghanistan | 94.2% |
| Thailand | 93.1% |
| Uzbekistan | 92.3% |
| Myanmar | 92.1% |
| Laos | 92.1% |
| Tajikistan | 91.1% |
| Nepal | 90.9% |
| Malaysia | 90.2% |
| Cambodia | 89.8% |
| Turkmenistan | 87.4% |
| Pakistan | 86.7% |
| Sri Lanka | 86.6% |
| Australia | 85.2% |
| Indonesia | 84.4% |
| Philippines | 78.0% |
| Singapore | 75.3% |
| Mongolia | 74.8% |
| New Zealand | 74.6% |
| China | 74.1% |
| Vietnam | 73.0% |
| Kyrgyzstan | 71.2% |
| Georgia | 68.6% |
| Azerbaijan | 63.5% |
| Taiwan | 53.9% |
| South Korea | 51.8% |
| Kazakhstan | 44.2% |
| Armenia | 43.6% |
| Japan | 34.4% |
| Middle East | |
| Palestinian Territories | 92.1% |
| Jordan | 90.8% |
| Iraq | 89.7% |
| Kuwait | 86.9% |
| Lebanon | 85.0% |
| Yemen | 84.7% |
| United Arab Emirates | 83.5% |
| Saudi Arabia | 82.4% |
| Turkey | 79.6% |
| Israel | 75.6% |
| Iran | 68.0% |
| Americas | |
| Nicaragua | 93.5% |
| Venezuela | 92.3% |
| Dominican Republic | 90.8% |
| Mexico | 88.5% |
| Honduras | 88.3% |
| Argentina | 87.1% |
| Costa Rica | 87.1% |
| Panama | 86.4% |
| Guatemala | 86.3% |
| Ecuador | 84.7% |
| Colombia | 81.7% |
| Brazil | 81.1% |
| El Salvador | 77.4% |
| Paraguay | 77.2% |
| Canada | 76.6% |
| United States | 75.8% |
| Bolivia | 75.2% |
| Chile | 75.1% |
| Uruguay | 74.0% |
| Haiti | 70.1% |
| Peru | 69.8% |
| Africa | |
| Egypt | 97.1% |
| Liberia | 96.5% |
| Ethiopia | 95.7% |
| Tanzania | 95.6% |
| Rwanda | 94.2% |
| Sierra Leone | 92.9% |
| Malawi | 92.8% |
| Kenya | 90.8% |
| Mozambique | 89.9% |
| Nigeria | 89.2% |
| Burundi | 88.5% |
| Comoros | 87.9% |
| The Gambia | 87.3% |
| Ghana | 86.4% |
| Zimbabwe | 85.9% |
| Niger | 85.2% |
| Madagascar | 84.4% |
| Uganda | 84.3% |
| Namibia | 83.9% |
| Zambia | 81.7% |
| Chad | 81.2% |
| South Africa | 81.1% |
| Botswana | 80.8% |
| Benin | 80.6% |
| Morocco | 78.9% |
| Tunisia | 78.3% |
| Guinea | 78.3% |
| Libya | 78.2% |
| Ivory Coast | 75.9% |
| Eswatini | 74.9% |
| Republic of Congo | 73.8% |
| Mauritania | 73.7% |
| Senegal | 73.0% |
| Cameroon | 72.4% |
| Mali | 69.7% |
| Burkina Faso | 67.9% |
| Algeria | 64.9% |
| Mauritius | 61.0% |
| Gabon | 60.8% |
| Togo | 53.8% |
| Europe | |
| Spain | 82.5% |
| Norway | 82.1% |
| Portugal | 80.5% |
| Malta | 78.3% |
| United Kingdom | 77.4% |
| Greece | 76.9% |
| Ireland | 76.9% |
| Finland | 76.7% |
| Italy | 75.1% |
| Sweden | 72.6% |
| Slovenia | 71.6% |
| Bosnia and Herzegovina | 70.9% |
| Denmark | 70.5% |
| Luxembourg | 69.3% |
| Serbia | 67.8% |
| Netherlands | 67.3% |
| Germany | 66.7% |
| Cyprus | 64.1% |
| Iceland | 62.4% |
| Albania | 61.5% |
| Belgium | 60.9% |
| Croatia | 58.0% |
| Austria | 55.8% |
| Macedonia | 55.2% |
| Lithuania | 53.5% |
| Switzerland | 51.9% |
| France | 50.9% |
| Estonia | 48.6% |
| Montenegro | 44.6% |
| Latvia | 44.2% |
| Former Soviet Union | |
| Hungary | 78.9% |
| Poland | 76.4% |
| Slovakia | 74.2% |
| Czech Republic | 65.2% |
| Romania | 64.8% |
| Russia | 43.7% |
| Moldova | 43.0% |
| Bulgaria | 39.4% |
| Belarus | 37.8% |
| Ukraine | 30.2% |